00001 00002 CommandInsertVehicle::CommandInsertVehicle(osg::Vec3 pos,OSGWindows* osgwind, 00003 string pathname,float scale) 00004 00005 { 00006 osgwind_=osgwind; 00007 vehicle=new Vehicle(pathname,scale); 00008 vehicle->getObjectGroup()->setUserData(vehicle); 00009 osgwind_->addObject(vehicle); 00010 insertedObjs_.push_back(vehicle); 00011 vehicle->setPosition(pos.x(),pos.y(),pos.z()); 00012 vehicle->setPositionAll(pos.x(),pos.y(),pos.z()); 00013 } 00014 00015 bool CommandInsertVehicle::execute() 00016 { 00017 00018 osgwind_->doAddGeode(vehicle); 00019 00020 return true; 00021 } 00022 00023 bool CommandInsertVehicle::unexecute() 00024 { 00025 00026 osgwind_->doDeleteGeode(vehicle); 00027 00028 return true; 00029 00030 } 00031 00032
1.4.6-NO